<template>
	<view>
		<view class="description" v-for="(item,index) in list" :key="index" @click="skip(item)">
			<view class="description_top">
				<view class="fl">
					<text>{{item.tWaybill.shipZone}}</text>
					<image src="../../static/iocn4.png"></image>
					<text>{{item.tWaybill.receiveZone}}</text>
				</view>
				<view class="fr">{{item.tWaybill.creationTime}}</view>
			</view>
			<view class="description_key">
				<text>货物信息：{{item.tWaybill.goodsName}} / {{item.tWaybill.goodsPackagMethod}} / {{item.tWaybill.goodsSize}}m³ / {{item.tWaybill.goodsWeight}}T </text>
				<text>车辆信息：{{item.tWaybill.lesscarload}} / {{item.tWaybill.demandLength}} / {{item.tWaybill.demandLoad}}T / {{item.tWaybill.demandStyle}}</text>
			</view>
			<view class="description_box">
				<view class="boxfl">
					<view class="viewtop">
						<image src="../../static/iocn8.png"></image>
						<text>{{item.tDriver.trueName}}</text>
					</view>
					<view class="viewbox">
						<view>
							<text>运费：</text> 
							<text class="texta">{{item.offerNow}}元</text>
						</view>
						<view>
							<text>订金：{{item.deposit}}元</text>
							<text class="textb" v-if="item.tWaybill.returnDeposit == true">（可退还）</text>
							<text class="textb" v-else>（不可退还）</text>
						</view>
					</view>
				</view>
				<view class="boxfr">已报价</view>
			</view>
		</view>
		<view v-if="list == 0">
			<u-empty mode="message" icon="http://cdn.uviewui.com/uview/empty/message.png"></u-empty>
		</view>
		<view>
			<Tabbar :current="'0'"></Tabbar>
		</view>
	</view>
</template>

<script>
	import {GetOfferList} from '@/public/Api/update.js'
	import {
		setValue,
		getValue
	} from '@/public/storeage/index.js'
	import Tabbar from '@/pages/navigation/navigation.vue';
	export default {
		components: {
			//注册组件
			Tabbar
		},
		data() {
			return {
				list: [],
				skipCount:0,
				maxResultCount:10,
				waybillId:''
			}
		},
		onLoad(options) {
			this.waybillId = options.id
			this.GetOfferList()
		},
		methods: {
			skip(e) {
				var id = e.id
				console.log(id)
				uni.navigateTo({
					url: '/pages/quotedprice/Detailspage?id=' + id
				})
			},
			
			
			// 获取报价列表
			async GetOfferList() {
				var skipCount = this.skipCount
				var maxResultCount = this.maxResultCount
				var waybillId = this.waybillId
				try {
					const {
						data: res
					} = await GetOfferList({
						skipCount,
						maxResultCount,
						waybillId
					})
					this.list = res.result.items
				} catch (e) {}
			},
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #f7f7f7;
		padding: 0 15upx;
	}

	.description {
		margin-top: 20upx;
		border-radius: 17.52upx;
		box-shadow: 1.75upx 1.75upx 7.01upx 0px #cccccc, 1.75upx 1.75upx 7.01upx 0px #cccccc;
		padding: 0 38upx;
		background-color: #fff;

		.description_top {
			display: flex;
			align-items: center;
			justify-content: space-between;

			.fl {
				display: flex;
				align-items: center;

				text {
					font-size: 28.04upx;
					font-weight: bold;
					color: #000;
				}

				image {
					width: 109upx;
					height: 109upx;
				}
			}

			.fr {
				font-size: 15.77upx;
				color: rgba(56, 56, 56, 1);
			}
		}

		.description_key {
			margin-top: -30upx;
			padding-bottom: 20upx;
			border-bottom: 2upx solid #e5e5e5;

			text {
				display: block;
				font-size: 21.03upx;
				font-weight: 400;
				color: rgba(56, 56, 56, 1);
				padding-top: 15upx;
			}
		}

		.description_box {
			padding: 14upx 0;
			display: flex;
			align-items: flex-end;
			justify-content: space-between;

			.boxfl {
				display: flex;
				align-items: flex-start;

				.viewtop {
					image {
						width: 88upx;
						height: 88upx;
					}

					text {
						display: block;
						font-size: 17.52upx;
						font-weight: 400;
						text-align: center;
					}
				}

				.viewbox {
					padding-left: 25upx;

					view {
						display: flex;
						align-items: center;
						padding-top: 10upx;

						text {
							font-size: 24.53upx;
							font-weight: bold;
							color: rgba(0, 0, 0, 1);
						}

						.texta {
							color: #EF4D3D;
						}

						.textb {
							color: #808080;
						}
					}
				}
			}

			.boxfr {
				width: 112.15upx;
				height: 45.56upx;
				opacity: 1;
				border-radius: 8.76upx;
				background: #EF4D3D;
				font-size: 28.04upx;
				color: #fff;
				font-weight: bold;
				text-align: center;
				line-height: 45.56upx;
			}
		}
	}
</style>
